package com.daohang361.imqq.ui.headtree;

import java.awt.Image;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;

import com.csu.client.module.vo.MsgUser;
import com.daohang361.imqq.resourse.ResourcesManagement;

/**
 */
public class UserPopoInfo extends JFrame implements MouseListener{
	private MsgUser user;
	public UserPopoInfo(){
	}
	
	public UserPopoInfo(MsgUser user){
		this.user=user;
		JLabel Jlabel=new JLabel(user.getUserName());
		Icon icon=new ImageIcon(this.getClass().getResource("1111.jpg"));
		Jlabel.setIcon(icon);
		this.setTitle(user.getUserName()+"的基本信息");
		String iconImagePath="head/"+(String)user.getAttribute("headImage")+".gif";
		Image image=ResourcesManagement.getImage(iconImagePath,32,32);
		this.getContentPane().add(Jlabel);
		this.setIconImage(image);
		this.setSize(300, 180);
		this.setUndecorated(true);
		this.setAlwaysOnTop(true);
//		com.sun.awt.AWTUtilities.setWindowOpacity(this, 0.9f);
	}

	public void mouseClicked(MouseEvent e) {
		
	}

	public void mouseEntered(MouseEvent e) {
		this.setVisible(true);
	}

	public void mouseExited(MouseEvent e) {
		this.setVisible(false);
	}

	public void mousePressed(MouseEvent e) {
		
	}

	public void mouseReleased(MouseEvent e) {
		
	}

	public static void main(String[] args) {
		UserPopoInfo loadingFrame=new UserPopoInfo();
	    loadingFrame.setLocationRelativeTo(null);
	    loadingFrame.setVisible(true);
	}
}
